package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class ClearImg {

    @Reference
    private OrderSettingService orderSettingService;

    public void clear(){
        Date date = new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        String format = sdf.format(date);
        List<String> list = orderSettingService.findOrderDate(format);
        for (String s : list) {
            orderSettingService.deleteByOrderDate(s);
        }
    }
}
